const hhgConfig = [
	{
		hhgTitle: '基本信息',
		hhgColumn: 'CREATE',
		hhgList: [
			{ hhgKey: ['basicInfoForm', 'requester'], hhgValue: '', hhgType: 'inputMember', hhgCol: 8 },
			{ hhgKey: ['basicInfoForm', 'requesterDept'], hhgValue: [], hhgType: 'select', hhgCol: 8, config: {
				labelName: '部门(多岗位请自选)',
				name: ['basicInfoForm', 'requesterDept'],
				checkable: false
			} },
			{ hhgKey: ['basicInfoForm', 'requesterTel2'], hhgValue: '', hhgType: 'input', hhgCol: 8, config: {
				labelName: '座机',
				name: ['basicInfoForm', 'requesterTel2']
			} },
			{ hhgKey: ['basicInfoForm', 'version2'], hhgValue: '', hhgType: 'input', hhgCol: 8, config: {
				labelName: '所属应用',
				name: ['basicInfoForm', 'version2']
			} }
		]
	},
	{
		hhgTitle: '业务信息',
		hhgColumn: 'CREATE',
		hhgList: [
			{ hhgKey: ['helpInfo', 'description'], hhgValue: '', hhgType: 'textArea', hhgCol: 24, config: {
				labelName: '描述',
				name: ['helpInfo', 'description']
			} },
			{ hhgKey: ['mixMember'], hhgValue: [], hhgType: 'mixedMember', hhgCol: 24 },
			{ hhgKey: ['attachmentDocs'], hhgValue: [], hhgType: 'upload', hhgCol: 24 },
		]
	},
	{
		hhgTitle: '审批操作',
		hhgColumn: 'APPROVAL',
		hhgList: [
			{ hhgKey: ['approvalDecision', 'value'], hhgValue: {}, hhgType: 'radioMember', hhgCol: 24 }
		]
	},
	{
		hhgTitle: '历史审批记录作',
		hhgColumn: 'APPROVAL',
		hhgSloTextra: true,
		hhgList: [
			{ hhgKey: ['recordList'], hhgValue: [], hhgType: 'recordTable', hhgCol: 24 }
		]
	}
]
// 辅助函数，用于根据key路径在对象中设置值
const setValueByPath = (obj, keys, value) => {
	let target = obj
	for (let i = 0; i < keys.length - 1; i++) {
		const key = keys[i]
		if (!target[key]) {
		target[key] = {}
		}
		target = target[key]
	}
	target[keys[keys.length - 1]] = value
}
export { hhgConfig, setValueByPath }